﻿-if (!popup)    
  -if (!create && lockOrderInfo == null && ((user is User) && ((user as User).HasAnyPermission("DocumentRecieve,DocumentExecute,DocumentIssue,UnlockOrder,EditRows")) || (user.HasPermission("DocumentExecuteComplicated") && entity.IsComplicated) || (user.HasPermission("DocumentExecute") && !entity.IsComplicated)) )
    -if (!readOnly)
      -foreach(var s in statuses)
        %input.btn{tabindex="40", type="image", src=String.Format("img/statuses/{0}",s.Image24), title=s.ActionName, alt=s.ActionName, onclick=String.Format("return changeStatus({0},'{1}','{2}','{3}');", s.Id, (s.Name.IndexOf("Отказ") > -1).ToString(), (s.Name.IndexOf("Выдано") > -1).ToString(), (s.IsReturnAfterSave ? "True": "") )}
    -else 
      -foreach(var s in statuses)
        %a.btnstatus{tabindex="40", href="#", onclick=String.Format("return changeStatusReadOnly({0},{1},{2},'{3}','{4}','{5}')", entity.Id, s.Id, entity.StatusId, (s.Name.IndexOf("Отказ") > -1).ToString(), (s.Name.IndexOf("Выдано") > -1).ToString(), (s.IsReturnAfterSave ? "True": ""))}
          %img{src=String.Format("img/statuses/{0}",s.Image24), title=s.ActionName, alt=s.ActionName, width="37", height="31"}
